<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<script src="js/axios-0.18.0.js"></script>
<script>
    //发送一个get请求
    /*axios({
        method:"get",
        url:"http://localhost:80/axiosServlet?username=zhangsan"
    }).then(function (resp){
        alert(resp.data);
    })*/
    //get别名方式
    /*axios.get("http://localhost:80/axiosServlet?username=zhangsan").then(function (resp){
        alert(resp.data)
    });*/
    //发送一个post请求
    /*axios({
        method:"post",
        url:"http://localhost:80/axiosServlet",
        data:"username=zhangsan"
    }).then(function (resp){
        alert(resp.data);
    })*/
    //post起别名方式
    axios.post("http://localhost:80/axiosServlet","username=zhangsan").then(function (resp){
        alert(resp.data)
    })
</script>

</body>
</html>